#ifndef _SERVO_SG90_H_
#define _SERVO_SG90_H_
#include <ESP32_Servo.h> // <Servo.h>
#include "ServoBase.h"


/**
* @brief:
* SG90/MG90s servo
*/
class CServoSG90 : public CServoPWM
{
public:
	CServoSG90();
	virtual ~CServoSG90();

	virtual ServoRet_t Init(int pin);
	virtual void Uninit();
	virtual bool IsOffsetSupport();
	virtual ServoRet_t SetAngle(uint16_t angle, uint32_t msec);
	virtual ServoRet_t GetAngle(uint16_t &angle);
	virtual ServoRet_t SetOffset(int16_t offset);
	virtual ServoRet_t GetOffset(int16_t &offset);
	virtual ServoRet_t SetId(uint8_t newid);
	virtual ServoRet_t SetLed(bool on);
	virtual ServoRet_t Terminate();
	virtual ServoRet_t GetFirmware(uint32_t &firmware);
	virtual ServoRet_t Lock();
	virtual ServoRet_t Unlock();

protected:
	Servo m_servo;
};


#endif

